package org.github.p2w.entity;

import cn.hutool.core.util.StrUtil;
import lombok.Data;

import java.util.List;

/**
 * postman 实体类
 *
 * @author xiayongchao
 * @date 2022/08/02
 */
@Data
public class Postman {

    private Info info;

    private List<Item> item;

    public String getFileName() {
        String name = info.getName();
        if (StrUtil.isBlank(name)) {
            return "接口文档";
        }
        if (name.endsWith("接口") || name.endsWith("文档") || name.endsWith("api")
                || name.endsWith("API")) {
            return name;
        }
        return name + "接口文档";
    }

}
